<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/11/5
  Time: 11:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>loginChk</title>
</head>
<body>
<%--创建数据对象，保存用户登录信息；
调用方法进行验证；
验证通过，转发至welcome.jsp，
否则loginerr.jsp，请求重新登录--%>

<%--创建对象--%>
<jsp:useBean id="user" class="bean.UserBean"></jsp:useBean>

<%--利用你的请求参数给user对象的属性进行赋值--%>
<jsp:setProperty name="user" property="*"></jsp:setProperty>

<jsp:useBean id="userChk" class="controller.UserChkController"></jsp:useBean>

<%
    boolean flag = userChk.checkUser(user);
    if(flag){
        request.getRequestDispatcher("welcome.jsp").forward(request,response);
    }else{
        request.getRequestDispatcher("error.jsp").forward(request,response);
    }
%>
</body>
</html>
